library(data.table)
library(dplyr)
library(ggplot2)
library(ggsci)
library(haven)
library(tidyr)
library(stringr)
library(extrafont)
library(qwraps2)
library(stats)
library(Weighted.Desc.Stat)

dir.project <- './'
dir.data <- paste0(dir.project,'data/')
dir.raw <- paste0(dir.data,'raw/')
dir.generated <- paste0(dir.data,'generated/')

## figures directory for output
dir.fig.paper <- paste0(dir.project,'doc/paper/figures/data_appendix/')

dat <- fread(paste0(dir.generated,'r/morg_data_stacked_90.csv')) %>% filter(wagesample==1)

ggplot(dat, aes(x=reorder(Recode_desc,hrwage16,median),y=log(hrwage16))) + geom_boxplot() + coord_flip() +
  xlab("") + ylab("log hourly wage")

ggsave(paste0(dir.fig.paper,"boxplot_2digit.pdf"),width = 14, height = 8, units = "cm")

